:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --secondary-color: #3a86ff;
    --text-color: #333;
    --text-light: #666;
    --background-color: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--white);
    padding: 20px;
    text-align: center;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.date-display {
    font-size: 0.9rem;
    opacity: 0.9;
}

main {
    padding: 20px;
}

.input-section {
    margin-bottom: 20px;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

#task-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

#task-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.add-btn:hover {
    background-color: var(--primary-light);
    transform: scale(1.05);
}

.filters {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background-color: var(--white);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.filter-btn:hover {
    background-color: var(--background-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.task-container {
    position: relative;
    min-height: 200px;
}

.task-list {
    list-style: none;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background-color: var(--background-color);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--success-color);
}

.task-text {
    flex: 1;
    font-size: 1rem;
    word-break: break-word;
}

.task-text.completed {
    text-decoration: line-through;
    color: var(--text-light);
}

.task-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: var(--transition);
}

.task-item:hover .task-actions {
    opacity: 1;
}

.edit-btn, .delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.edit-btn {
    color: var(--secondary-color);
}

.edit-btn:hover {
    background-color: rgba(58, 134, 255, 0.1);
}

.delete-btn {
    color: var(--danger-color);
}

.delete-btn:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.empty-state span {
    font-size: 0.9rem;
    opacity: 0.8;
}

footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background-color);
}

.task-stats {
    font-size: 0.9rem;
    color: var(--text-light);
}

.clear-btn {
    background: none;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.clear-btn:hover {
    background-color: var(--danger-color);
    color: var(--white);
}

.clear-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 编辑模式样式 */
.edit-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    margin-right: 10px;
}

.save-btn, .cancel-btn {
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.save-btn {
    background-color: var(--success-color);
    color: var(--white);
    margin-right: 8px;
}

.save-btn:hover {
    background-color: #45a049;
}

.cancel-btn {
    background-color: var(--text-light);
    color: var(--white);
}

.cancel-btn:hover {
    background-color: #555;
}

/* 响应式设计 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 12px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .filters {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item {
    animation: fadeIn 0.3s ease;
}

/* 滚动条样式 */
.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track {
    background: var(--background-color);
}

.task-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.task-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}